<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%@ page session="true"%>

<div class="header">
	<div class="site-title">
		<a href="${pageContext.request.contextPath}/forum">Forum</a>
	</div>
	<div class="header-links">
		<div class="username">

			<c:choose>
  				<c:when test="${sessionScope.identity.fullName != null}">
  					<a href="${pageContext.request.contextPath}/settings">${sessionScope.identity.fullName}</a>
  				</c:when>
  				<c:otherwise>
  					<a href="${pageContext.request.contextPath}/login">Login</a>
  				</c:otherwise>
			</c:choose>			
		</div>
		<div class="add-discussion">
			<a href="${pageContext.request.contextPath}/addpost"> Aggiungi +</a>
		</div>
		<div class="logout">
			<a href="${pageContext.request.contextPath}/forum?logout"> Logout </a>
		</div>
	</div>
	<form method="get" class="search"
		action="${pageContext.request.contextPath}/forum">
		<input name="filter" class="input" type="text" placeholder="Cerca">
		<input type="submit" style="visibility: hidden;">
	</form>
</div>